strSQL = "SELECT Count(Distinct Artists.ID) AS CountOfID FROM Artists WHERE Artists.ID IN ( SELECT ArtistsSongs.IDArtist FROM ArtistsSongs WHERE ArtistsSongs.PersonType = 1 AND ArtistsSongs.IDSong IN ( SELECT Played.IDSong FROM Played))"
strSQL = "SELECT Count(Distinct Albums.ID) AS CountOfID FROM Albums WHERE Albums.ID IN ( SELECT Songs.IDAlbum FROM Songs WHERE Songs.ID IN (SELECT Played.IDSong FROM Played))"
strSQL = "SELECT Count(Genres.IDGenre) AS Nombre FROM Genres WHERE Genres.GenreName <> '' AND Genres.IDGenre IN (SELECT GenresSongs.IDGenre FROM GenresSongs)"
strSQL = "SELECT Count(Distinct Genres.IDGenre) AS CountOfID FROM Genres WHERE Genres.IDGenre IN (SELECT GenresSongs.IDGenre FROM GenresSongs WHERE GenresSongs.IDSong IN (SELECT Played.IDSong FROM Played))"
strSQL = "SELECT Count(Distinct CAST((Songs.Year/10000) AS INTEGER)) AS CountOfID FROM Songs INNER JOIN Played ON Songs.ID = Played.IDSong WHERE Songs.Year > 0"
strSQL = "SELECT Sum(Songs.SongLength) AS TotalLength, Sum(Songs.FileLength) AS TotalFileLength FROM Songs WHERE Songs.ID IN (SELECT Played.IdSong FROM Played)"
strSQL = "SELECT Avg(Distinct Cast((Songs.Year/10000) AS Integer)) AS avgYearPlayed FROM Songs INNER JOIN Played ON Songs.ID = Played.IDSong WHERE Songs.Year > 0"
strSQL = "SELECT Count( Songs.ID) AS CountOfID FROM Songs WHERE (Songs.Album <> '') AND (Songs.Album NOTNULL) AND Songs.IDAlbum IN "
strSQL = strSQL & "(SELECT Albums.ID FROM Albums WHERE Albums.ID IN ( SELECT Songs2.IDAlbum FROM Songs AS Songs2 WHERE Songs2.ID IN (SELECT Played.IDSong FROM Played)))"
strSQL = strSQL & "WHERE ArtistsSongs.PersonType = 1 AND Songs.ID = ArtistsSongs.IDSong AND Songs.ID IN (SELECT Played.IDSong FROM Played) AND ArtistsSongs.IDArtist = Artists.ID "
strSQL = strSQL & "GROUP BY ArtistsSongs.IDArtist "
strSQL = "SELECT Songs.AlbumArtist AS Artist, Albums.Album AS Album, Avg( Songs.Rating) AS Rating, Sum(Songs.SongLength) AS TotalLength, Sum(Songs.FileLength) AS TotalFileLength "
strSQL = strSQL & "FROM Songs, Albums "
strSQL = strSQL & "WHERE Albums.ID <> 0 AND Albums.Album <> '' AND Albums.ID = Songs.IDAlbum "
strSQL = strSQL & "GROUP BY Songs.IDAlbum, Albums.Album "
strSQL = "SELECT Songs.AlbumArtist AS Artist, Albums.Album AS Album, Sum( PlayCounter) AS CountOfID, Sum(Songs.SongLength) AS TotalLength, Sum(Songs.FileLength) AS TotalFileLength "
strSQL = strSQL & "FROM Songs, Albums "
strSQL = strSQL & "WHERE Albums.ID <> 0 AND Albums.Album <> '' AND Albums.ID = Songs.IDAlbum AND "
strSQL = strSQL & "Songs.ID IN (SELECT Played.IDSong FROM Played) "
strSQL = strSQL & "GROUP BY Songs.IDAlbum, Albums.Album "
strSQL = "SELECT Count(Songs.ID) AS CountOfID, Sum(Songs.SongLength) AS TotalLength, Sum(Songs.FileLength) AS TotalFileLength, Genres.GenreName FROM GenresSongs, Songs, Genres WHERE Songs.ID = GenresSongs.IDSong AND GenresSongs.IDGenre = Genres.IDGenre GROUP BY GenresSongs.IDGenre ORDER BY Count(Songs.ID) DESC LIMIT " & intTopCount & ""
strSQL = "SELECT Count(Songs.ID) AS CountOfID, Sum(Songs.SongLength) AS TotalLength, Sum(Songs.FileLength) AS TotalFileLength, Genres.GenreName FROM GenresSongs, Songs, Genres WHERE Songs.ID = GenresSongs.IDSong AND Songs.ID IN (SELECT Played.IDSong FROM Played) AND GenresSongs.IDGenre = Genres.IDGenre GROUP BY GenresSongs.IDGenre ORDER BY Count(Songs.ID) DESC LIMIT " & intTopCount & ""
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 96) AND (Songs.Rating <= 100)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 86) AND (Songs.Rating <= 95)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 76) AND (Songs.Rating <= 85)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 66) AND (Songs.Rating <= 75)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 56) AND (Songs.Rating <= 65)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 46) AND (Songs.Rating <= 55)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 36) AND (Songs.Rating <= 45)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 26) AND (Songs.Rating <= 35)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 16) AND (Songs.Rating <= 25)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 6) AND (Songs.Rating <= 15)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE Songs.Rating = 0"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 96) AND (Songs.Rating <= 100) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 86) AND (Songs.Rating <= 95) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 76) AND (Songs.Rating <= 85) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 66) AND (Songs.Rating <= 75) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 56) AND (Songs.Rating <= 65) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 46) AND (Songs.Rating <= 55) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 36) AND (Songs.Rating <= 45) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 26) AND (Songs.Rating <= 35) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 16) AND (Songs.Rating <= 25) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE (Songs.Rating >= 6) AND (Songs.Rating <= 15) AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then
strSQL = "SELECT Songs.Rating, Count(Songs.ID) AS CountOfID, Sum(SongLength) AS TotalLength, Sum(FileLength) AS TotalFileLength FROM Songs WHERE Songs.Rating = 0 AND Songs.ID IN (SELECT Played.IDSong FROM Played)"
Set qryStats = SDB.Database.OpenSQL(strSQL)
If CLng(qryStats.StringByName("CountOfID")) > 0 Then